﻿<UserControl x:Class="Mengsk.ProxyDelivery.App.UI.Order.OrderReturnOutUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="800" Loaded="UserControl_Loaded">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <StackPanel Grid.Row="0" Orientation="Horizontal">
            <TextBlock Text="退货编号:" Margin="3" VerticalAlignment="Center"/>
            <TextBox Name="tbOrderChangeId" Margin="3" VerticalAlignment="Center" Width="100" PreviewKeyDown="tbOrderChangeId_PreviewKeyDown"/>
            <Button Name="btnPrint" Content="打印" Width="80" Margin="3" VerticalAlignment="Center" Click="btnPrint_Click"/>
            <Button Name="btnMark" Content="标记出货" Width="80" Margin="3" VerticalAlignment="Center" Click="btnMark_Click"/>
            <Button Name="btnClear" Content="清空" Width="80" Margin="3" VerticalAlignment="Center" Click="btnClear_Click"/>
            <TextBlock Name="tbCount" Margin="3" VerticalAlignment="Center"/>
        </StackPanel>

        <DataGrid Grid.Row="1" IsReadOnly="True" Name="dgvItems" GridLinesVisibility="All" AutoGenerateColumns="False" SelectionMode="Extended" SelectionUnit="FullRow" CanUserAddRows="False" >
            <DataGrid.Columns>
                <DataGridTextColumn Header="退货编号" Binding="{Binding OrderChange.Id}"/>
                <DataGridTextColumn Header="订单编号" Binding="{Binding OrderChange.OrderId}"/>
                <DataGridTextColumn Header="卖家编号" Binding="{Binding OrderChange.SellerId}"/>
                <DataGridTextColumn Header="商品信息" Binding="{Binding OrderChange.GoodsInfo}"/>
                <DataGridTextColumn Header="商品金额" Binding="{Binding OrderChange.GoodsMoney}"/>
                <DataGridTextColumn Header="商品数量" Binding="{Binding OrderChange.Count}"/>
                <DataGridTextColumn Header="当前状态" Binding="{Binding OrderChange.State,Converter={StaticResource descriptionConverter}}"/>
                <DataGridHyperlinkColumn Header="删除" Width="Auto" Binding="{Binding Path=Action}" IsReadOnly="True">
                    <DataGridHyperlinkColumn.ElementStyle>
                        <Style>
                            <EventSetter Event="Hyperlink.Click" Handler="Delete_Click"/>
                        </Style>
                    </DataGridHyperlinkColumn.ElementStyle>
                </DataGridHyperlinkColumn>
            </DataGrid.Columns>
        </DataGrid>

    </Grid>
</UserControl>
